﻿using UnityEngine;
using System.Collections;

public class Pickup : Poolable
{

	public GameObject myPickupSound;

	public void OnTriggerEnter (Collider col)
	{
		if (col.transform.tag == "Player") 
		{
			Instantiate(myPickupSound);
			if(col.GetComponent<Inventory>())
			{
				col.GetComponent<Inventory>().GetPickup (gameObject);
				myPooler.AddToPool(gameObject, myStack);
			}
				
		}
	}
}
